class FlickrException(Exception):
    """
    Base flickr exception, all exceptions thrown by the API should be
    subclasses of this one
    """
    def __init__(self, code, message):
        self.code = code
        self.message = message
    
    def __str__(self):
        return 'Error %d - %s' % (self.code, self.message)

class InvalidAPIKey(FlickrException):
    pass

class ServiceUnavailable(FlickrException):
    pass

class InvalidResponseFormat(FlickrException):
    pass

class InvalidMethod(FlickrException):
    pass

class InvalidSignature(FlickrException):
    pass

class MissingSignature(FlickrException):
    pass

class InvalidAuthToken(FlickrException):
    pass

class InsufficientPermissions(FlickrException):
    pass

exceptions_list = {
    96: InvalidSignature,
    97: MissingSignature,
    98: InvalidAuthToken,
    99: InsufficientPermissions,
    100: InvalidAPIKey,
    105: ServiceUnavailable,
    111: InvalidResponseFormat,
    112: InvalidMethod,
}